package cn.edu.cque.mall.controller;

import cn.edu.cque.mall.entity.Category;
import cn.edu.cque.mall.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @ClassName CategoryController
 * @Description
 * @Author chen
 * @Date 2020/10/11 0011 19:51
 */
@Controller
@RequestMapping("/category")
public class CategoryController {
    @Autowired
    CategoryService categoryService;

    @RequestMapping("list")
    @ResponseBody
    public List<Category> findAll() {
        return categoryService.findAll();
    }
}
